{% if include.img %}
  {% assign header_icon = include.img %}
{% elsif page.header_icon %}
  {% assign header_icon = page.header_icon %}
{% endif %}
{% if include.name %}
  {% assign header_title = include.name %}
{% elsif page.header_title %}
    {% assign header_title = page.header_title %}
{% endif %}
{% if header_icon and header_title %}
  <header class="page-header">
    <div class="container">
      {% if header_icon %}
        <div class="page-header-icon">
          <img src="{{ header_icon }}" alt="header icon"/>
        </div>
      {% endif %}

      <div class="page-header-title">
        {% if page.breadcrumbs %}
          <ul class="breadcrumbs">
            {% for breadcrumb in page.breadcrumbs %}
              <li class="breadcrumb-item{% if page.url == breadcrumb[1] %} active{% endif %}">
                {% if page.id == 'page-plugin' %}
                <a href="https://konghq.com/plugins">Plugins</a>
                {% else %}
                <a href="{{ breadcrumb[1] }}">{{ breadcrumb[0] }}</a>
                {% endif %}
              </li>
            {% endfor %}
          </ul>
        {% endif %}

        <h1>{{ header_title }}</h1>

        {% if page.header_caption or include.header_caption%}
          <p>{{ page.header_caption }}{{ include.header_caption }}</p>
        {% endif %}
      </div>

      {% if page.header_btn_repo_href %}
        <div class="page-header-right">
          {% if page.header_btn_repo_text %}
            <a class="page-header-btn" href="{{ page.header_btn_repo_href | liquify }}" target="{{ page.header_btn_repo_target }}">{{ page.header_btn_repo_text | liquify }}</a>
          {% else %}
            <a class="page-header-btn page-header-btn-repo" href="{{ page.header_btn_repo_href | liquify }}" target="{{ page.header_btn_repo_target }}">Source&nbsp;Code</a>
          {% endif %}
        </div>
      {% endif %}

      {% if page.header_html %}
        <div class="page-header-right">
          {{ page.header_html }}
        </div>
      {% endif %}
    </div>
  </header>
{% endif %}
